/*
 * @(#)QuadTree.java
 *
 * Project:		JHotdraw - a GUI framework for technical drawings
 *				http://www.jhotdraw.org
 *				http://jhotdraw.sourceforge.net
 * Copyright:	� by the original author(s) and all contributors
 * License:		Lesser GNU Public License (LGPL)
 *				http://www.opensource.org/licenses/lgpl-license.html
 */


package org.jhotdraw.standard;

import org.jhotdraw.framework.FigureEnumeration;

import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.io.Serializable;

/**
 * @author Anne Lorayne, João Targino, Júlia Adélia, Saulo Toledo e Thalita Gonçalves 
 * @version <$CURRENT_VERSION$>
 */
class QuadTree extends QuadTreeUtil implements Serializable {

	//______________________________________________________CONSTRUCTORS

	public QuadTree(Rectangle2D absoluteBoundingRectangle2D) {
		this(2, absoluteBoundingRectangle2D);
	}

	public QuadTree(int nMaxTreeDepth, Rectangle2D
		absoluteBoundingRectangle2D) {
		super(nMaxTreeDepth, absoluteBoundingRectangle2D);
	}

	//____________________________________________________PUBLIC METHODS

	public void add(Object anObject, Rectangle2D absoluteBoundingRectangle2D) {
		super.add(anObject, absoluteBoundingRectangle2D);
	}
	
	public Object remove(Object anObject) {
		return super.remove(anObject);	
	}
	
	public void clear() {
		super.clear();
	}

	public int getMaxTreeDepth() {
		return super.getMaxTreeDepth();
	}

//Método abaixo comentado desde o projeto original	
/*
	public FigureEnumeration getAll() {
		List l = CollectionsFactory.current().createList();
		l.add(_theHashtable.keySet());
		l.add(_outsideHashtable.keySet());

		if (_nMaxTreeDepth > 1) {
			l.add(_nwQuadTree.getAll().toList());
			l.add(_neQuadTree.getAll().toList());
			l.add(_swQuadTree.getAll().toList());
			l.add(_seQuadTree.getAll().toList());
		}

		return new FigureEnumerator(l);
	}
*/
	public FigureEnumeration getAllWithin(Rectangle2D r) {
		return super.getAllWithin(r);
	}

	public Rectangle2D getAbsoluteBoundingRectangle2D() {
		return super.getAbsoluteBoundingRectangle2D();
	}

	//___________________________________________________PROTECTED METHODS

	protected void _init(int nMaxTreeDepth, Rectangle2D absoluteBoundingRectangle2D) {
		super._init(nMaxTreeDepth, absoluteBoundingRectangle2D);
	}

	protected Rectangle2D _makeNorthwest(Rectangle2D r) {
		return super._makeNorthwest(r);
	}

	protected Rectangle2D _makeNortheast(Rectangle2D r) {
		return super._makeNortheast(r);
	}

	protected Rectangle2D _makeSouthwest(Rectangle2D r) {
		return super._makeSouthwest(r);
	}

	protected Rectangle2D _makeSoutheast(Rectangle2D r) {
		return super._makeSoutheast(r);
	}

	protected void addFigureEnumerationToList(ArrayList l, FigureEnumeration fe) {
       super.addFigureEnumerationToList(l, fe);
    }

//_______________________________________________________________END

} //end of class QuadTree
